package com.chuangsi.project.admin.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 战败记录
 * </p>
 *
 * @author
 * @since 2024-05-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Defeat对象", description = "战败记录")
@TableName("t_defeat")
public class Defeat extends Model<Defeat> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "战败id")
    @TableId(value = "defeat_id", type = IdType.AUTO)
    @NotNull(message = "战败id不能为空")
    private Integer defeatId;

    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户id不能为空")
    private Long userId;

    @ApiModelProperty(value = "姓名")
    @Size(max = 100, message = "姓名长度过长")
    private String name;

    @ApiModelProperty(value = "电话")
    @Size(max = 50, message = "电话长度过长")
    private String phone;

    @ApiModelProperty(value = "品牌")
    @Size(max = 255, message = "品牌长度过长")
    private String brand;

    @ApiModelProperty(value = "车型")
    @Size(max = 255, message = "车型长度过长")
    private String model;

    @ApiModelProperty(value = "部门id")
    private Long deptId;

    @ApiModelProperty(value = "0：售前 1：售后")
    private Integer saleStatus;

    @ApiModelProperty(value = "驾龄")
    private Integer drivingExperience;

    @ApiModelProperty(value = "首次购车  0：是 1：不是")
    private Integer firstCar;

    @ApiModelProperty(value = "战败原因")
    @Size(max = 255, message = "战败原因长度过长")
    private String reason;

    @ApiModelProperty(value = "回访记录")
    @Size(max = 255, message = "回访记录长度过长")
    private String followUpRecords;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


    @Override
    public Serializable pkVal() {
        return this.defeatId;
    }

}
